<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>管理员登录页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="/NBS/jquery/jquery-1.5.1.js"></script>
	<script type="text/javascript">
		function checkForm() {
			if(!$("#adminname").val()) {
				alert("管理员名称不能为空！");
				return false;
			}
			if(!$("#adminpwd").val()) {
				alert("管理员密码不能为空！");
				return false;
			}
			return true;
		}
		
		
		
		function closeWP() {
			 window.location.href="about:blank";
			 window.close();
			}
		
		
		function closewin(){  
		    if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") !=-1) {  
		        window.location.href="about:blank";  
		        window.close();  
		    } else {  
		        window.opener = null;  
		        window.open("", "_self");  
		        window.close();  
		    }  
		}  
	</script>
	
	  <style type="text/css">
	*{
		margin:0px; /*消除外边距*/
		padding:0px;/*消除内边距*/
		background:url("/NBS/images/back.jpg") gray 100% no-repeat fixed;
		background-size:cover;/*让背景图片覆盖整个浏览器*/
	}
	.login{
		position:absolute;/*将div设置为绝对定位*/
		top:42%;/*距离浏览器的上边距有45%的距离*/
		left:42%;/*距离浏览器的左边距有45%的距离*/
		border:1px solid blue;/*设置div的粗细、实体、颜色*/
		width:260px;/*设置div的宽度*/
		text-align:center;/*设置div里的组件为居中*/
		border-radius:5px;/*设置圆角值*/
		box-shadow:1px 5px 10px;/*设置边框阴影*/
		line-height:40px;/*设置这里组件之间的距离*/
		padding-bottom:20px;
	}
	
	form input{
		width:200px;
		height:28px;
		border:none;/*将边框设置为没有*/
		box-shadow:1px 1px 5px #999999;/*将边框的背景设置为类似于灰色*/
		padding-left:26px;/*设置内左边距有多大*/
		outline:none;/*设置外边框样式*/
	}
	#submit,#submit1{
		cursor:pointer;/*当鼠标放上去显示的形状：pointer小手*/
		width:38%;
		margin-left:0px;
		text-align:center;
		padding-left:0px;
	}

	#submit:hover,#submit1:hover{  /*当id为submit的组件有鼠标放上去的时候会产生该事件*/
		box-shadow:1px 1px 5px red;
	}
	h1{
		font-size:20px;
		font-family:宋体;
	}
  </style>
  </head>
  
  <body>

<div  class="login">
	<h1>图书管理员登录</h1>
	<div id="time"></div>
	<form method="post" action="<c:url value="/AdminServlet" />" onsubmit="return checkForm()" target="_top">
		<p style="font-weight: 900; color: red">${msg }</p>
			<input type="hidden" name="method" value="login"/>
		<input id="adminname" style="background:url(/NBS/images/user.png) left no-repeat;" type="text" name="adminname" placeholder="Username" />
		<br/>
		<input id="adminpwd" style="background:url(/NBS/images/lock.png) left no-repeat;" type="password"  name="adminpwd"  placeholder="Password" />
		<br/>
		<input type="submit" value="登录" id="submit"/>  <input type="button" value="取消" id="submit1" onclick="closewin()"/>
	</form>
</div>
  </body>
</html>
